package com.hthy.futures.adapter;

import android.content.Context;

import com.hthy.futures.R;
import com.hthy.futures.base.CommonAdapter;
import com.hthy.futures.base.CommonViewHolder;
import com.hthy.futures.bean.HistoryData;
import com.hthy.futures.utils.StringUtils;

 /**
   * 资金流水adapter
   * Author:  Mr.bingley
   * Version:
   * Date:  2017/4/10
   */

public class HistoryDataCommonAdapter extends CommonAdapter<HistoryData>{
    public HistoryDataCommonAdapter(Context context, int layoutId) {
        super(context, layoutId);
    }

    @Override
    public void convert(CommonViewHolder vh, HistoryData item) {
        vh.setText(R.id.tv_bill_number, "单号:  " + item.get_$8115());
        vh.setText(R.id.tv_money, "金额:  " + StringUtils.toDoubleStr(item.getDbChangeAmount()));
        vh.setText(R.id.tv_balance, "余额:  " + StringUtils.toDoubleStr(item.getDbBalance()));
        vh.setText(R.id.tv_time, "时间:  " + item.getSsExecuteTime());

        // 8028 子订单类型 1 - buy , 2 - sell , 3 - buy limit 4 - buy stop 5 - sell limit 6 - sell stop
        int item_$8028 = item.getUiChangeType();
        //int orderType = Integer.parseInt(item_$8028);
        switch (item_$8028) {
            case '1':
                vh.setText(R.id.tv_type, "入金");
                break;
            case '2':
                vh.setText(R.id.tv_type, "出金");
                break;
            case '3':
                vh.setText(R.id.tv_type, "盈亏");
                break;
            case '4':
                vh.setText(R.id.tv_type, "递延费");
                break;
            case '5':
                vh.setText(R.id.tv_type, "手续费");
                break;
            case '6':
                vh.setText(R.id.tv_type, "调整信用金");
                break;
            case '7':
                vh.setText(R.id.tv_type, "强平冲正");
                break;
            case '8':
                vh.setText(R.id.tv_type, "无负债结算盈亏");
                break;
            case '9':
                vh.setText(R.id.tv_type, "冲正处理");
                break;
            case 'A':
                vh.setText(R.id.tv_type, "手续费点差");
                break;
            case 'B':
                vh.setText(R.id.tv_type, "手续费结转");
                break;
            case 'C':
                vh.setText(R.id.tv_type, "盈亏结转");
            case 'D':
                vh.setText(R.id.tv_type, "无负债结算盈亏结转");
                break;
            case 'E':
                vh.setText(R.id.tv_type, "递延费结转");
            case 'F':
                vh.setText(R.id.tv_type, "红冲");
                break;
            case 'G':
                vh.setText(R.id.tv_type, "蓝补");
                break;
            case 'H':
                vh.setText(R.id.tv_type, "交收款");
                break;
            case 'I':
                vh.setText(R.id.tv_type, "交收费");
                break;
            case 'J':
                vh.setText(R.id.tv_type, "出金手续费");
                break;
            case 'K':
                vh.setText(R.id.tv_type, "出金手续费结转");
                break;
            case 'L':
                vh.setText(R.id.tv_type, "交收款结转");
                break;
            case 'M':
                vh.setText(R.id.tv_type, "交收费结转");
                break;
            case 'N':
                vh.setText(R.id.tv_type, "调账入金");
                break;
            case 'O':
                vh.setText(R.id.tv_type, "调账出金");
                break;
            case 'P':
                vh.setText(R.id.tv_type, "交易所手续费划转银行");
                break;
            case 'Q':
                vh.setText(R.id.tv_type, "收取利息");
                break;
            case 'R':
                vh.setText(R.id.tv_type, "支付利息");
                break;
            case 'S':
                vh.setText(R.id.tv_type, "第三方扣款");
            case 'T':
                vh.setText(R.id.tv_type, "第三方退款");
                break;
            case 'U':
                vh.setText(R.id.tv_type, "第三方手续费");
                break;
            case 'a':
                vh.setText(R.id.tv_type, "交收保证金");
                break;
            case 'b':
                vh.setText(R.id.tv_type, "交收货款");
                break;
            case 'c':
                vh.setText(R.id.tv_type, "交收违约金");

                break;
        }
    }
}
